package com.weilive.push.service.umeng;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.weilive.core.utils.DateUtil;
import com.weilive.push.service.umeng.android.AndroidBroadcast;
import com.weilive.push.service.umeng.android.AndroidCustomizedcast;
import com.weilive.push.service.umeng.android.AndroidFilecast;
import com.weilive.push.service.umeng.android.AndroidGroupcast;
import com.weilive.push.service.umeng.android.AndroidUnicast;
import com.weilive.push.service.umeng.ios.IOSBroadcast;
import com.weilive.push.service.umeng.ios.IOSCustomizedcast;
import com.weilive.push.service.umeng.ios.IOSFilecast;
import com.weilive.push.service.umeng.ios.IOSGroupcast;
import com.weilive.push.service.umeng.ios.IOSUnicast;

public class Demo {
	private String appkey = null;
	private String appMasterSecret = null;
	private String timestamp = null;

	public Demo(String key, String secret) {
		try {
			appkey = key;
			appMasterSecret = secret;
			timestamp = Integer.toString((int) (System.currentTimeMillis() / 1000));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public void sendAndroidBroadcast() throws Exception {
		AndroidBroadcast broadcast = new AndroidBroadcast();
		broadcast.setAppMasterSecret(appMasterSecret);
		broadcast.setPredefinedKeyValue("appkey", this.appkey);
		broadcast.setPredefinedKeyValue("timestamp", this.timestamp);
		broadcast.setPredefinedKeyValue("ticker", "Android broadcast ticker");
		broadcast.setPredefinedKeyValue("title", "中文的title");
		broadcast.setPredefinedKeyValue("text", "Android broadcast text");
		broadcast.setPredefinedKeyValue("after_open", "go_app");
		broadcast.setPredefinedKeyValue("display_type", "notification");
		// TODO Set 'production_mode' to 'false' if it's a test device.
		// For how to register a test device, please see the developer doc.
		broadcast.setPredefinedKeyValue("production_mode", "true");
		// Set customized fields
		broadcast.setExtraField("test", "helloworld");
		broadcast.send();
	}

	public void sendAndroidUnicast() throws Exception {
		AndroidUnicast unicast = new AndroidUnicast();
		unicast.setAppMasterSecret(appMasterSecret);
		unicast.setPredefinedKeyValue("appkey", this.appkey);
		unicast.setPredefinedKeyValue("timestamp", this.timestamp);
		// TODO Set your device token
		unicast.setPredefinedKeyValue("device_tokens", "xxxx");
		unicast.setPredefinedKeyValue("ticker", "Android unicast ticker");
		unicast.setPredefinedKeyValue("title", "中文的title");
		unicast.setPredefinedKeyValue("text", "Android unicast text");
		unicast.setPredefinedKeyValue("after_open", "go_app");
		unicast.setPredefinedKeyValue("display_type", "notification");
		// TODO Set 'production_mode' to 'false' if it's a test device.
		// For how to register a test device, please see the developer doc.
		unicast.setPredefinedKeyValue("production_mode", "true");
		// Set customized fields
		unicast.setExtraField("test", "helloworld");
		unicast.send();
	}

	public void sendAndroidGroupcast() throws Exception {
		AndroidGroupcast groupcast = new AndroidGroupcast();
		groupcast.setAppMasterSecret(appMasterSecret);
		groupcast.setPredefinedKeyValue("appkey", this.appkey);
		groupcast.setPredefinedKeyValue("timestamp", this.timestamp);
		/*
		 * TODO Construct the filter condition: "where": { "and": [
		 * {"tag":"test"}, {"tag":"Test"} ] }
		 */
		JSONObject filterJson = new JSONObject();
		JSONObject whereJson = new JSONObject();
		JSONArray tagArray = new JSONArray();
		JSONObject testTag = new JSONObject();
		JSONObject TestTag = new JSONObject();
		testTag.put("tag", "test");
		TestTag.put("tag", "Test");

		tagArray.add(testTag);
		tagArray.add(TestTag);

		whereJson.put("and", tagArray);
		filterJson.put("where", whereJson);
		System.out.println(filterJson.toString());

		groupcast.setPredefinedKeyValue("filter", filterJson);
		groupcast.setPredefinedKeyValue("ticker", "Android groupcast ticker");
		groupcast.setPredefinedKeyValue("title", "中文的title");
		groupcast.setPredefinedKeyValue("text", "Android groupcast text");
		groupcast.setPredefinedKeyValue("after_open", "go_app");
		groupcast.setPredefinedKeyValue("display_type", "notification");
		// TODO Set 'production_mode' to 'false' if it's a test device.
		// For how to register a test device, please see the developer doc.
		groupcast.setPredefinedKeyValue("production_mode", "true");
		groupcast.send();
	}

	public void sendAndroidCustomizedcast() throws Exception {
		AndroidCustomizedcast customizedcast = new AndroidCustomizedcast();
		customizedcast.setAppMasterSecret(appMasterSecret);
		customizedcast.setPredefinedKeyValue("appkey", this.appkey);
		customizedcast.setPredefinedKeyValue("timestamp", this.timestamp);
		// TODO Set your alias here, and use comma to split them if there are
		// multiple alias.
		// And if you have many alias, you can also upload a file containing
		// these alias, then
		// use file_id to send customized notification.
		customizedcast.setPredefinedKeyValue("alias", "xx");
		// TODO Set your alias_type here
		customizedcast.setPredefinedKeyValue("alias_type", "xx");
		customizedcast.setPredefinedKeyValue("ticker", "Android customizedcast ticker");
		customizedcast.setPredefinedKeyValue("title", "中文的title");
		customizedcast.setPredefinedKeyValue("text", "Android customizedcast text");
		customizedcast.setPredefinedKeyValue("after_open", "go_app");
		customizedcast.setPredefinedKeyValue("display_type", "notification");
		// TODO Set 'production_mode' to 'false' if it's a test device.
		// For how to register a test device, please see the developer doc.
		customizedcast.setPredefinedKeyValue("production_mode", "true");
		customizedcast.send();
	}

	public void sendAndroidFilecast() throws Exception {
		AndroidFilecast filecast = new AndroidFilecast();
		filecast.setAppMasterSecret(appMasterSecret);
		filecast.setPredefinedKeyValue("appkey", this.appkey);
		filecast.setPredefinedKeyValue("timestamp", this.timestamp);
		// TODO upload your device tokens, and use '\n' to split them if there
		// are multiple tokens
		filecast.uploadContents("aa" + "\n" + "bb");
		filecast.setPredefinedKeyValue("ticker", "Android filecast ticker");
		filecast.setPredefinedKeyValue("title", "中文的title");
		filecast.setPredefinedKeyValue("text", "Android filecast text");
		filecast.setPredefinedKeyValue("after_open", "go_app");
		filecast.setPredefinedKeyValue("display_type", "notification");
		filecast.send();
	}

	public void sendIOSBroadcast() throws Exception {
		IOSBroadcast broadcast = new IOSBroadcast();
		broadcast.setAppMasterSecret(appMasterSecret);
		broadcast.setPredefinedKeyValue("appkey", this.appkey);
		broadcast.setPredefinedKeyValue("timestamp", this.timestamp);

		broadcast.setPredefinedKeyValue("alert", "IOS 广播测试");
		broadcast.setPredefinedKeyValue("badge", 0);
		broadcast.setPredefinedKeyValue("sound", "chime");
		// TODO set 'production_mode' to 'true' if your app is under production
		// mode
		broadcast.setPredefinedKeyValue("production_mode", "false");
		// Set customized fields
		broadcast.setCustomizedField("test", "helloworld");
		broadcast.send();
	}

	public void sendIOSUnicast() throws Exception {
		IOSUnicast unicast = new IOSUnicast();
		unicast.setAppMasterSecret(appMasterSecret);
		unicast.setPredefinedKeyValue("appkey", this.appkey);
		unicast.setPredefinedKeyValue("timestamp", this.timestamp);
		// TODO Set your device token
		unicast.setPredefinedKeyValue("device_tokens", "xx");
		unicast.setPredefinedKeyValue("alert", "IOS 单播测试");
		unicast.setPredefinedKeyValue("badge", 0);
		unicast.setPredefinedKeyValue("sound", "chime");
		// TODO set 'production_mode' to 'true' if your app is under production
		// mode
		unicast.setPredefinedKeyValue("production_mode", "false");
		// Set customized fields
		unicast.setCustomizedField("test", "helloworld");
		unicast.send();
	}

	public void sendIOSGroupcast() throws Exception {
		IOSGroupcast groupcast = new IOSGroupcast();
		groupcast.setAppMasterSecret(appMasterSecret);
		groupcast.setPredefinedKeyValue("appkey", this.appkey);
		groupcast.setPredefinedKeyValue("timestamp", this.timestamp);
		/*
		 * TODO Construct the filter condition: "where": { "and": [
		 * {"tag":"iostest"} ] }
		 */
		JSONObject filterJson = new JSONObject();
		JSONObject whereJson = new JSONObject();
		JSONArray tagArray = new JSONArray();
		JSONObject testTag = new JSONObject();
		testTag.put("tag", "iostest");
		tagArray.add(testTag);
		whereJson.put("and", tagArray);
		filterJson.put("where", whereJson);
		System.out.println(filterJson.toString());

		// Set filter condition into rootJson
		groupcast.setPredefinedKeyValue("filter", filterJson);
		groupcast.setPredefinedKeyValue("alert", "IOS 组播测试");
		groupcast.setPredefinedKeyValue("badge", 0);
		groupcast.setPredefinedKeyValue("sound", "chime");
		// TODO set 'production_mode' to 'true' if your app is under production
		// mode
		groupcast.setPredefinedKeyValue("production_mode", "false");
		groupcast.send();
	}

	public void sendIOSCustomizedcast() throws Exception {
		IOSCustomizedcast customizedcast = new IOSCustomizedcast();
		customizedcast.setAppMasterSecret(appMasterSecret);
		customizedcast.setPredefinedKeyValue("appkey", this.appkey);
		customizedcast.setPredefinedKeyValue("timestamp", this.timestamp);
		// TODO Set your alias here, and use comma to split them if there are
		// multiple alias.
		// And if you have many alias, you can also upload a file containing
		// these alias, then
		// use file_id to send customized notification.
		customizedcast.setPredefinedKeyValue("alias", "xx");
		// TODO Set your alias_type here
		customizedcast.setPredefinedKeyValue("alias_type", "xx");
		customizedcast.setPredefinedKeyValue("alert", "IOS 个性化测试");
		customizedcast.setPredefinedKeyValue("badge", 0);
		customizedcast.setPredefinedKeyValue("sound", "chime");
		// TODO set 'production_mode' to 'true' if your app is under production
		// mode
		customizedcast.setPredefinedKeyValue("production_mode", "false");
		customizedcast.send();
	}

	public void sendIOSFilecast() throws Exception {
		IOSFilecast filecast = new IOSFilecast();
		filecast.setAppMasterSecret(appMasterSecret);
		filecast.setPredefinedKeyValue("appkey", this.appkey);
		filecast.setPredefinedKeyValue("timestamp", this.timestamp);
		// TODO upload your device tokens, and use '\n' to split them if there
		// are multiple tokens
		filecast.uploadContents("aa" + "\n" + "bb");
		filecast.setPredefinedKeyValue("alert", "IOS 文件播测试");
		filecast.setPredefinedKeyValue("badge", 0);
		filecast.setPredefinedKeyValue("sound", "chime");
		// TODO set 'production_mode' to 'true' if your app is under production
		// mode
		filecast.setPredefinedKeyValue("production_mode", "false");
		filecast.send();
	}

	public static void main(String[] args) {
		// TODO set your appkey and master secret here
		// Demo demo = new Demo("55e957ece0f55a412200064a",
		// "nssslckneouaqu761y4fqn1hrfpec3ol");
		try {

			String token1 = "AtgAHF5IU3VEOZXU1IAgXflrkjtrPQx-W2jq7jeFX1V2";
			String token2 = "AtxdxZyHzXIK5kKloW3D7Egao-Ergi1J6iVgoP3Dr1dB";

			String msg = "主播[000000000000000000000000000000]开播了";
			long userId = 10000L;

			List<String> list = new ArrayList<String>();
			list.add(token1);
			list.add(token2);
			
			String s = "1:AkmLIU4u11Pr0EJ831Vf_rqKPGl12CN-vwxxSmeyYWjv, 1:Atq2093rEqk-IONuVxxIUUG1QSRdjjinjRj0EDNc6v9b, 1:AkwYY70MjVeSE4mbIK-alOfLKZpSgnBhmlvaUPbLaHXY, 0:daa0d7aa49435969a80687c97f5978fa8cdf2394933bfb612849525d7786e704, 0:1558c14efb92f5113e5472e68d03ae72af97d285679fa0ad5a05cee607aaf93b, 0:dabb0a3dbb8f2da4428a4464d666296a72dd07c56d6f047524270dd12dec77d7, 1:AtApx4keQzXpktjS0VgLwUEJMMq47jmvmP6lg2ho-xF6, 1:Apmkul5M9SIm_RWsLwdglIDKNTyPknw4T4_4AL6XaW5S, 1:AsL_dm7Yr9BdHEJikWtfJC9Oi2pC--0Rh1g1ZH4WEmJS, 1:AkI9QwQMxSiL0nySiGA06KjNWPQeh6eb87Jz2oEB3fW7, 0:0d44d34804760478f465ffa7b837515b53b61eaa9aa3533f80e0eb7bbd5f3fd5, 0:aa04a70267e0e790e8355bc70d79b74043aabc5368db987c4e28fe61683e1132, 1:AmW34UYLWLbVVp-8fxgHwd_ZNGnI_x6ade5n4rRJeZNP, 1:AsTdYmn70vphrRPlSTdgQB5iJq3SlaYj_QyVze6mUsge, 0:844e14a4ee1e7409fff7f952e1e18bb6b8b166ac83ed07477fd35ef2919f2e26, 0:1337af4a6a3f880c10c664e5f5c111b4fc117101753cf8afc52da099e8199f48, 0:4fbe415a057801314e220fa84e47b96edfc28b0e7874c7f582d37dc2ce8946f3, 0:87bbb31a1278e5e2d4059f2b1e398c6d09f46d9c6296a39c8fe8e3ff169dc7a7, 1:AqxzuKmxMje2cpcSOQEQ4aj1dOHSd_jv_mf_RB5gxBqX, 0:2c5c094dcc04935a514d53a7555caa0429475f8161bfe3922afee8163559867d, 1:Ajvbz_ig5w83AlTthkaVIojGz-HFGW2YFqRfyCXPXNVE, 1:ArYw0uThPekbtuR8ObrTA2WpmlkmTQZaD9tMKKax_nTW, 1:AgL-RMjgvHidNMgAXUGTEdaPxFjulioJJKJov5mWSwc7, 1:Arp1BSM5--yFIGa_nWrqsQS9WtRrXNYgpl6T6r6Mjeka, 1:AtxY3-LAJO5a4zQqyVTySHmc8X5-Wj9XNOIoMo0ZIpsi, 1:AiYyVtQQl-5sgoXcSmZi1NwkybXVF5-JGFMDsgv-O7xp, 0:7e6ef2a39a0897896838a366b573332a49bd76bac9231b43b7f3a0c8153c5629, 0:d8574c1f57dee434a331b4da64fd60fe648a1c425e66bc5747d0872f6ac4114f, 0:446b0ee5e14b54d5d3593f6d89e8c6fc247e6c626d877573fbc49d1eeef9a26a, 0:6d8c3610a1197aa085325b56de98825b2e3dbe635ba232576d542acb4d811062, 1:AqZWeXHsD7kZ7myDKK_fw15s_9vm4-szysMFOXu5c7p4, 1:AnN9FTgUajiDi_eI71Yqi1T69Nyh-7tex60-EHzCp9CH, 1:AitHFv1kYOa23tN82ZVU9fYSDwLSF-MQu8CujyWqEwcm, 0:ed3c63317d2afd11f8c40b274edf3c3af176e29cdcd6ebba40fe721e2b1c0564, 1:AtxdxZyHzXIK5kKloW3D7Egao-Ergi1J6iVgoP3Dr1dB, 0:238a3d94ee19a8aba299f846962cab3a6c00e0521d81f59dec6852b796fceb13, 0:a4a75241f52c3b12e2ea72c8f283abba057cc680470173b5d93168fff9d9b907, 1:AjvwPcxf6rAXpGxcX49dV1RbyAwFTvm5jB9N7r5g9qf9, 0:8bfef5126f7433c5f9ee0bd8202ed766f9763a9e94162fc103a79944bc6f3fb7, 0:0d5c1b8ba0729d73b10967e671e20363144f0cdb3b9ec59e326255f8d0590039, 1:Apr-FiqZgruhyRmZh0_7x-13umVLMT4OCFLIpujCaVE0, 1:An9CHTO92Tt_XyEqDdTOjFqTtotGkHTACQWQc6BekUOk, 0:19498ab339f52cde56132cdcadfb893f0b42eec46c08cac33bca776cbb1a1e36, 1:AqPBRLk-L9eOQSfQhuFhwO27lAGFajGe7ir9GXfCMTC0, 1:Amz2ZYJBpNE990LRXFoPHSGoIBUK0GaU4uxRy2t-i6nk, 1:Aj9zYYn6PODZ0ShD9nUw4OI8UBLMdqSgWArP3bHnyZP4, 1:AsT0gNt935R0UViOALFn6SYald4UWdEaGGsl1dbl1jU6, 1:AtLy8k8whEMBjiTuD4j1uNTk38WLTCuK5BmIrMC9LhdV, 0:936779ce71df11e1154ecb5511234660cdab1b9a9d35eb4671f80e9843590fc7, 1:AowbpSd8FynMhFh4eVwMlo83eaPfMPGzIUjhpV-muu86, 1:AiE6ZHIqdms7fb3NoTT9mQ_qMAc-qBLYX04FUJYlNTxw, 0:596dda2fe3126c62a36f96d3271699f14323f53b8bb4f82a83d24ef1bc9c0df2, 0:199bb88f1a27748ee77478467b663e602b96ee85ebf1d618083981b1f355fffb, 0:6ccbb0d557aed68c0b208380de6a0e40c80713ffb67b2632f6cfc2eda32a535e, 0:82c3eef271fc49399717ea2a6e998bf4688228f1452fef4a9b919c639aa28e67, 1:Aho6iRAmJab7m5W3-iQJYSPPuGXVXCQ8EtfGWEoaIkyr, 1:AmEHhSTtZFwCrh3kQ7T3tyjIDjoTkqHQnI_dwcHaXdyi, 0:c2e73787dbee742d2571672c6847db7c6e7273eeb4a3fb9f2f52cfe6e807dcbc, 0:0f02bfa9cf2c47f378c86ab32ba8b49c2a92568a934afedd083528c79fa42bad, 1:AoDuj4EhGtdJdCq2Dcpwizg03NC-iJKuj45bm5JffKuF, 1:AspmX7CCO_rlm0zi79zUUHxc-MrtdL45txpXJ0yjH9wK, 0:f6329e05a3c5ff4209782f176e7d14147d84d6c4bd5476fb3aaf0dbf5e7f87f8, 1:AkWUeRM_vQAtgSOFhQgT7VmLv7ehNgWhtOdrTOMRTTzo, 1:Alj1l8gSSHNLWVbob1Eml0vyHee6etNAGQAVcAnOi47j, 0:791afd21be72abe099049f6b23060ccb7141f144f397f7a4013d48caff6c90a0, 1:AjCGJqVeDi0NzpnbOhnNfMQmfRr0mZpCPqgWWKOTZd8V, 1:At2VbuZWVObia7_M4ck4E2ESBut-wWEsabJ92jZs9QtW, 0:a794348f4cf0a64833f8c707a3ba5f67e80d931b4bb8b7b98bf7bd1f6d39c523, 0:87df0f724748880ea4e869084d394fcda0eb11ffa12e47d6e2c1ac0168140f58, 0:bd124f0e44bdadc36f9e9c7595a6fb4fd82cbe0da154a56894ce3251f22aaa7d, 1:AjH-j2nO6bplkgTZvLFiEUYrW2G4s02OZPqQLJVPcSPu, 1:AkXTorw0160gnxN2ftTGQA8nZN3qdj6OxRGSVk5z5Ieo, 1:AiqStjMfAuY37ecmn5ON3XrQSuJFfcxnTJmrM4wbNoyi, 0:fe6bba2dcfff43f66afc37913a7f74bfe45ad5abf78477df83c262d476491770, 1:AlTJ_0PbS41UacTA2ZNlsDQvG8ge2rhRQu-WEtSukyC-, 1:ApS5nSo_nOwIZ-yxocenXdXqst8PRMamKaenEp_fumcs, 0:e4129df0e2716bd4812f7e0c051b0cce431eecf282307076bfe51f38a96abd16, 1:AqabBoXfPkDi2a1TOEsze6GwsysXYWJ8ByKQMJgtTGfG, 1:Ao5FOiHMfzpnOvLMWtgsD6zoWUmFO16lpzpCQEQa3hmo, 0:f87b845133ef5fc1ef9ab0b9839fcaaefbebf3038c8098f9e1d1be794e9ceefd, 1:AhN7pShCnBGTL9VyUBpNmBjs2djJRgXbFtJz-BqN4XOx, 0:77daf2921ef8765692b53c17dd90f8c8b753cce4fdb648c23c4d65c22b8e57e8, 0:e5daece76566226b162ea9cd6992cb6e63825229fb5b3a748aaacfa5d6c2c30f, 0:c503a6439819fc8bddc99a2b6cec588dd4f5d0723a97aacd4b12a46de383715a, 1:AtUSyeyqm81sI9rU1MlEYu-bVJjegQF7UgS6tMvOT8hl, 0:a7a66f77a4e5eef5a561e0396d7f9016d474b573b74a7f27e9e656d99ff9f895, 1:AvelWMc-F_FhjHnZv1ZxHeguNhGAmuWQjEtxfkY61A5f, 0:31f7ec0ae843427670ce8b5df0c34800a1f6c3a6761862cac859097ef4f9acfe, 1:AroZSBajS0L9dgtl1Q2Q1uz-LAjyTGwuLh7byRf8Aftl, 1:AqosXEBYguZVdt39ldslH1L2ds-QxqR54u7HRZxDmXOA, 0:b001961ea10842519773076fce56cac040798898c823b96c07e6cca13df08a55, 0:8fff12167d173d1b4598deb04b0ba82d562beec017436f846fbcf5c05edbf29f, 0:161969d12b3a0967dd9ba2e5f3728478578fc7c96756613a3001f14b477df1db, 1:AqMP2AixJJFHsOkQO-uBUpHV0P1CuABhZgBhKmTF0HWE, 0:e6f1f04ae8b2b1746591f73df60c887fb9b5ee9e1cfc67d89623d6af5b208a87, 0:4e55c50c1020ac15ea4974b6be3f224a85281a17c2feb62c55bfc0ac0ca3d05d, 1:AuOeNRsNgP-mHdngtc0hG5jWl2mFiW9-wRKvEy6U3kUO, 0:032fbea5299ce619d53b4b87561ce7fd70ff4c262eda82e186ac97f1dfbd0daf, 0:3e05bf734fe81adda8b8458bc8688ebbe0dc7813875c50b55ad326ff2cdb3dec, 0:08a22deb0b6cb30c37823e643a7f58c77c989e963aaf4a1e68cd6de5f70ef4a0, 1:AkG8SKKQSjIDddz2payEgED9VKTKfT2w-g2rJbcKG9Kx, 0:a753d386f195ce9a0aa9d009df3da2cd8fb79436f3802673fbe2c1f5e1f83326, 0:392fc7a03cd89071d94cba5c72c6ea6f82b298ba49b13d6cd6f8967a17ea89de, 1:Atq2093rEqk-IONuVxxIUUF_S3RPa9I2_zWoAxSBnM7S, 1:Aqpky_it6tGbMrvY6Sk_UyIgZaqVcN-qlfke8MOQudak, 1:AtgAHF5IU3VEOZXU1IAgXflrkjtrPQx-W2jq7jeFX1V2, 0:bbc405c203fc614b1c121c4b31095a6b2a0e3f391de6ee7d29d4f1cd118796e8, 1:AuChxxe36YL_ASS0-6rfy7PZHWyVH5Dyn1YIQrWe-nI6";
			
			
			String[] str = s.split(",");
			
			List<String> android = new ArrayList<String>();
			
			for(String v : str){
				if(v.trim().startsWith("1")){
					String[] vv = v.trim().split(":");
					
					android.add(vv[1]);
				}
			}
			
			System.out.println(android);

			String contents = "";
			
			for(String v : android){
				if(v.length() > 0){
					contents += "\n";
				}
				contents += v;
			}

			// UmengPuser.AndroidBroadcast(msg, userId);
			// UmengPuser.AndroidUnicast(token1, msg, userId);
			// UmengPuser.AndroidUnicast(token2, msg, userId);
			// UmengPuser.AndroidListcast(list, msg, userId);
		   //UmengPuser.AndroidFilecast(contents, msg, userId, 1);
			
			//UmengPuser.AndroidListcast(android, msg, userId, 1);

			// demo.sendIOSUnicast();
			/*
			 * TODO these methods are all available, just fill in some fields
			 * and do the test demo.sendAndroidBroadcast();
			 * demo.sendAndroidGroupcast(); demo.sendAndroidCustomizedcast();
			 * demo.sendAndroidFilecast();
			 * 
			 * demo.sendIOSBroadcast(); demo.sendIOSUnicast();
			 * demo.sendIOSGroupcast(); demo.sendIOSCustomizedcast();
			 * demo.sendIOSFilecast();
			 */
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
}
